
<html>
<head>

<link href="../css/style.css" rel="stylesheet" type="text/css">
</head>
<body>

<div id="boxbody"  <?php 
 $searchedname=$_REQUEST["champion"];;
 echo "style=\"Background:url(../img/skin/$searchedname.jpg) center fixed no-repeat;\"";		
		?>;>
<div id="boxall" style="top:0px;Background:none;">
<div id="boxshowchamp" >
<?php 
		
		if($searchedname==="")
			echo "Insert a Summoner name, please!";
		else{
		/**
		connessione database
		*/			
		$connessione = mysql_connect("localhost","root","","LOL") or die("Connessione al database fallita");
	 	mysql_select_db('LOL',$connessione); 
	 	//calcolo totale di champions usati
		$sql="SELECT * FROM `champion` WHERE nome = '$searchedname'";
	 	$weekchamp= mysql_query($sql);
			 	if(!$weekchamp)
			 		die("Esequzione della query fallita".mysql_error());
			 	if(mysql_num_rows($weekchamp) == 0){
			 		echo "I dati dei champions devono essere aggiornati<BR>";
			 	}
			 	else{
					echo "<p style=\"font-size:xX-large;font-weight: bold;COLOR:WHITE;	\"><img src=\"../img/champion/$searchedname.png\"  alt=\"\" />   ".strtoupper($searchedname)."</p>
						<table id=\"statistichechamp\" ><tr>";
					$row=mysql_fetch_assoc($weekchamp);
						echo "
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">Vita</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">Attacco</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">Difesa</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">Velocita</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">Prezzo</td></tr>";
						echo "
						<tr><td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">$row[vita]</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">$row[attacco]</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">$row[difesa]</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">$row[velocita]</td>
						<td style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">$row[prezzo]</td>";
					
					}
					echo "</tr></table>";
					echo "
					<p style=\"text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:75px;	\">Descrizione</p>
					<p style=\"padding:0px;margin:2px;text-align:left;width:60px;font-size:large;font-weight: bold;COLOR:WHITE;	width:500px;	\"	>$row[descrizione]</p>";
					/**
					 * FINE STAMPA
					 */
				mysql_free_result($weekchamp);
				mysql_close();
			
				/*
				fine connessione
				*/
				}
?> 
		
	</div>
	<div id="boxshowskill">
		<?php
	/**
	connessione database
	*/			
	$connessione = mysql_connect("localhost","root","","LOL") or die("Connessione al database fallita");
 	mysql_select_db('LOL',$connessione); 
 	//calcolo totale di champions usati
	$sql="SELECT * FROM skill WHERE champion = '$searchedname' ";
 	$skillschamp= mysql_query($sql);
		 	if(!$skillschamp)
		 		die("Esequzione della query fallita".mysql_error());
		 	if(mysql_num_rows($skillschamp) == 0){
		 		echo "I dati dei champions devono essere aggiornati<BR>";
		 	}
		 	else{
				echo "<p style=\"padding:0px;margin-bottom:2px;text-align:left;width:60px;font-size:x-large;font-weight: bold;COLOR:WHITE;	width:75px;	\">Abilita</p>";
					
				while($row=mysql_fetch_assoc($skillschamp)){
					echo "
						<table id=\"weekfree\" ><tr>
						<td style=\"text-align:center;width:60px;font-weight: bold;COLOR:WHITE;	width:75px;\">nome:<br>$row[nomeS]</td>
						<td style=\"text-align:center;width:60px;font-weight: bold;COLOR:WHITE;	width:75px;	\">danno:<br> $row[dannoS]</td>
						<td style=\"text-align:center;width:60px;font-weight: bold;COLOR:WHITE;	width:75px;	\">range:<br> $row[rangeS]</td>
						<td style=\"text-align:center;width:60px;font-weight: bold;COLOR:WHITE;	width:75px;	\">colldown:<br> $row[colldownS]</td>
						<td style=\"text-align:center;width:60px;font-weight: bold;COLOR:WHITE;	width:75px;	\">tasto:<br> $row[tasto]</td></tr></table>
						<p  style=\"padding:0px;margin-bottom:2px;text-align:left;COLOR:WHITE;	\">$row[descrizione]</p>
					";
						
				}
				
				/**
				 * FINE STAMPA
				 */
			mysql_free_result($skillschamp);
			mysql_close();
		
			/*
			fine connessione
			*/
			}
?> 
		
	</div>
</div>
</div>
</body>
</html>
		